From: Kenichi Handa Date: Thu, 19 Feb 2009 04:23:32 +0000 (+0000) Subject: (detect_coding): Don't overflow coding->carryover. X-Git-Tag: archive/raspbian/1%29.2+1-2+rpi1~1^2~421^2~1699 X-Git-Url: https://dgit.raspbian.org/%22http:/www.example.com/cgi/%22https:/www.github.com/%22bookmarks:///%22http:/www.example.com/cgi/%22https:/www.github.com/%22bookmarks:/?a=commitdiff_plain;h=87456099ffee2db3bf53ab51ec82fb43608aacab;p=emacs.git (detect_coding): Don't overflow coding->carryover. --- diff --git a/src/coding.c b/src/coding.c index ec57467f023..313e4021486 100644 --- a/src/coding.c +++ b/src/coding.c @@ -6805,6 +6805,8 @@ decode_coding (coding) coding->carryover. */ unsigned char *p = coding->carryover; + if (nbytes > sizeof coding->carryover) + nbytes = sizeof coding->carryover; coding->carryover_bytes = nbytes; while (nbytes-- > 0) *p++ = *src++;